home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
pascal
/
tpb4_src.zip
/
TPBMAIN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-09-13
|
12KB
|
532 lines
{ TPBoard 4.2 Copyright (c) 1987,88 by Jon Schneider & Rick Petersen
Portions Copyright (c) 1986,87 by Steve Fox and Les Archambault
Last modified :: 6-27-88 11:39 am
}
{$R-} {Range checking off}
{$B-} {Boolean complete evaluation off}
{$S-} {Stack checking off}
{$I+} {I/O checking on}
{$N-} {No numeric coprocessor}
Unit TPBMain;
Interface
Uses
TPCrt, TPDOS, Globals, Overmgr, Core1, MsgBuild,
Core2, Utilmnu2, Utilmnu1, MsgEntr, NetEntr,
EditUsr1, EditUsr2, MsgRead, MsgMisc, NetRead,
FileMnu1, FileMnu2, Download, Upload, Sysop1,
Sysop3, Sysop2, TypeFile, Initial1, Initial2,
Sysop4, Loginout, Misc;
procedure Make_Prompt;
procedure set_initial_areas;
procedure process_messages;
procedure process_files;
procedure process_utility;
procedure process_sysop;
{==========================================================================}
Implementation
procedure Make_Prompt;
var
temp : Str14;
begin
st := hi+white+intstr(time_left, 1)+'-'+yellow+pr_msg[mode]+white;
case mode of
message_mode :
begin
if AreaReq[1] = '-' then
begin
temp := AreaReq;
Delete(temp, 1, 1);
st := st+' Echo '+temp
end
else
st := st+' '+AreaReq;
end;
files_mode :
begin
st := st+' '+SectReq;
if in_library then
st := st+' ['+LibReq+']';
if in_arc then
st := st+' ['+ArcReq+']';
if new_dir then
if disp_dir then
directory(True)
else
directory(False);
if up_down_display then
begin
WriteLn(Com, white);
WriteLn(Com, user_rec.upload, ' uploads, ', user_rec.download,
' downloads to date.');
up_down_display := False;
end;
end;
end;
if (user_rec.access >= 250) and audit_on then
st := st+' (Audit ON) ';
st := st+cyan;
end;
procedure set_initial_areas;
begin
if not macro_in_progress then
begin
pause;
list('B');
pause;
repeat
until (not brk) or (not Online);
WriteLn(Com);
WriteLn(Com);
UserWantsScan := ask('Check ALL message areas for mail', 'Y');
WriteLn(Com);
end;
if user_rec.access >= 250 then
begin
mesg_area_change('SYSTEM');
file_area_change('NEWIN');
end
else
begin
mesg_area_change('POST');
file_area_change('LOGIN')
end;
end;
procedure process_messages;
begin
fido := ((AreaReq = 'NETMAIL') or (AreaReq[1] = '-'));
case ch of
'A' :
Articles;
'C' :
mesg_area_change('');
'E' :
if fido then
fido_mesg_enter(' ', dummy_str, dummy_subj, ' ', dummy_int)
else
begin
mesg_enter(' ');
mesg_build_index(AreaSet)
end;
'F' :
mode := files_mode;
'G' :
in_use := False;
'Q' :
if fido then
fido_mesg_read('Q')
else
mesg_quick_scan;
'R' :
if fido then
fido_mesg_read(' ')
else
mesg_read;
'S' :
if fido then
fido_mesg_read('S')
else
mesg_summary;
'U' :
mode := utility_mode;
'X' :
if (user_rec.access >= 250) or (not remote_copy) then
begin
if Length(menu_password) > 1 then
begin
menu_temp := prompt('Enter Password', 8, 'SN');
if menu_temp = menu_password then
mode := sysop_mode;
end
else
mode := sysop_mode;
end;
'B', 'I', 'W' :
list(ch);
'O' :
list_file('OTHERSYS.LST', HomName);
'?', '/' :
begin
list('M');
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end
else
begin
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end;
end;
end;
procedure process_files;
begin
if (st[1] = 'S') and
((test_bit(user_rec.flags, 1)) and (SectReq <> 'LOGIN')) then
list('S')
else if st = 'REN' then
rename_file
else if st = 'DEL' then
delete_file
else if st = 'COPY' then
copy_file
else if st = 'STAT' then
file_status
else if st = 'DIR' then
directory(True)
else if st = 'SG' then
SendXmodem('G')
else if st = 'SB' then
SendXmodem('B')
else if st = 'SY' then
SendXmodem('Y')
else if st = 'SX' then
SendXmodem('X')
else if st = 'SC' then
SendXmodem('C')
else if st = 'SO' then
SendXmodem('O')
else if st = 'SZ' then
SendXmodem('Z')
else if st = 'SQ' then
SendXmodem('Q')
else if st = 'RZ' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('Z');
end
else if st = 'RG' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('G');
end
else if st = 'RQ' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('Q');
end
else if st = 'RB' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('B');
end
else if st = 'RO' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('O');
end
else if st = 'RY' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('Y');
end
else if st = 'RX' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('X');
end
else if st = 'RC' then
begin
if in_library or in_arc then
ArcLbr;
RecvXmodem('C');
end
else if st = 'FIND' then
begin
if in_library or in_arc then
ArcLbr;
newin_list('F');
end
else if st = 'TYPE' then
SendText
else
case ch of
'A' :
ArcLbr;
'C' :
begin
if in_arc or in_library then
ArcLbr;
file_area_change('')
end;
'D' :
directory(True);
'F' :
files_list;
'G' :
in_use := False;
'L' :
begin
if in_library or in_arc then
ArcLbr;
newin_list('F');
end;
'M' :
mode := message_mode;
'N' :
begin
if in_library or in_arc then
ArcLbr;
newin_list('N');
end;
'R' :
begin
ch := user_rec.protocol;
if in_library or in_arc then
ArcLbr;
RecvXmodem(ch);
end;
'S' :
begin
ch := user_rec.protocol;
SendXmodem(ch)
end;
'T' :
SendText;
'U' :
mode := utility_mode;
'X' :
if (user_rec.access >= 250) or (not remote_copy) then
begin
if Length(menu_password) > 1 then
begin
menu_temp := prompt('Enter Password', 8, 'SN');
if menu_temp = menu_password then
mode := sysop_mode;
end
else
mode := sysop_mode;
end;
'Z' :
toggle_st_switch;
'?', '/' :
begin
list('F');
if user_rec.access >= 250 then
list('Z');
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end
else
begin
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end;
end;
end;
procedure process_utility;
begin
case ch of
'A' :
alter_user_params;
'C' :
if chat then
mesg_enter('S');
'F' :
mode := files_mode;
'G' :
in_use := False;
'M' :
mode := message_mode;
'P' :
get_protocol;
'S' :
display_stats;
'T' :
display_time;
'U' :
display_users;
'Y' :
show_user_stats;
'X' :
if (user_rec.access >= 250) or (not remote_copy) then
begin
if Length(menu_password) > 1 then
begin
menu_temp := prompt('Enter Password', 8, 'SN');
if menu_temp = menu_password then
mode := sysop_mode;
end
else
mode := sysop_mode;
end;
'Z' :
begin
if graphics then
graphics_off
else
graphics_on
end;
'?', '/' :
begin
list('U');
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end
else
begin
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end;
end;
end;
procedure process_sysop;
var
not_saved : Boolean;
begin
case ch of
'A' :
toggle_audit;
'B' :
make_message('', '', '', '');
'D' :
delete_user;
'E' :
edit_user('', '', 0);
'F' :
mode := files_mode;
'G' :
in_use := False;
'I' :
rebuild_index;
'L' :
print_log;
'M' :
mode := message_mode;
'N' :
process_newin;
'O' :
process_macro;
'P' :
purge_files;
'Q' :
in_use := False;
'R' :
print_messages;
'S' :
sys_dir;
'T' :
toggle_printer;
'U' :
mode := utility_mode;
'V' :
validate_user('', '');
'X' :
begin
if local_online or (not remote_copy) then
begin
ClrScr;
errcode := ExecDos(CommandPath, False, nil);
new_dir := True;
end
else
begin
ScrollOn;
errcode := ExecDos(CommandPath+' /C REMOTE', False, nil);
ScrollOff;
Ch_Init;
Ch_Set(rate);
end;
SetSect(HomName);
end;
'Y' :
move_from_newin;
'Z' :
if local_online then
full_screen_edit('', ' ', not_saved);
'?', '/' :
begin
list('X');
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end;
else
begin
if (not macro_in_progress) then
begin
mult_cmds := False;
Cmd_Queue := '';
Clear_inbuf;
end;
end;
end;
end;
end. { of TPBMAIN.PAS }